<%@ include file="/common/taglibs.jsp"%>

<title><fmt:message key="employeeDetail.title"/></title>
<content tag="heading"><fmt:message key="employeeDetail.heading"/></content>

<html:form action="saveEmployee" method="post" styleId="employeeForm" onsubmit="return validateEmployeeForm(this)">
<ul>

<html:hidden property="id"/>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.empNo"/>
        <html:errors property="empNo"/>
        <html:text property="empNo" styleId="empNo" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.empName"/>
        <html:errors property="empName"/>
        <html:text property="empName" styleId="empName" styleClass="text medium"/>

    </li>
    
    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.companyId"/>
        <!-- html:errors property="companyId"/-->
        <!-- html:text property="companyId" styleId="companyId" styleClass="text medium"/-->
            <html:select property="companyId">
            	<html:options collection="companys" property="companyId" labelProperty="companyName"/>
            </html:select>
    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.empEngName"/>
        <html:errors property="empEngName"/>
        <html:text property="empEngName" styleId="empEngName" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.sex"/>
        <!-- html:errors property="sex"/-->
        <!-- html:text property="sex" styleId="sex" styleClass="text medium"/-->
            <html:select property="sex">
            	<html:options collection="sexs" property="value" labelProperty="label"/>
            </html:select>
    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.empId"/>
        <html:errors property="empId"/>
        <html:text property="empId" styleId="empId" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.empDept"/>
        <!-- html:errors property="empDept"/-->
        <!-- html:text property="empDept" styleId="empDept" styleClass="text medium"/-->
            <html:select property="empDept">
            	<html:options collection="departments" property="deptId" labelProperty="deptName"/>
            </html:select>
    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.empPosition"/>
        <html:errors property="empPosition"/>
        <html:text property="empPosition" styleId="empPosition" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.positionNo"/>
        <html:errors property="positionNo"/>
        <html:text property="positionNo" styleId="positionNo" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.empTitle"/>
        <html:errors property="empTitle"/>
        <html:text property="empTitle" styleId="empTitle" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.mobile"/>
        <html:errors property="mobile"/>
        <html:text property="mobile" styleId="mobile" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.empHireDate"/>
        <html:errors property="empHireDate"/>
        <html:text property="empHireDate" styleId="empHireDate" styleClass="text medium"/>
            <A HREF="#" onclick="cal1.select(document.forms[0].empHireDate,'anchor1','yyyy/MM/dd');return false;"
                     title = "cal1.select(document.forms[0].empHireDate, 'anchor1', 'yyyy/MM/dd'); return false;"
                     id="anchor1" name="anchor1">                
            <fmt:message key="button.calendar"/>            
            </A> 
    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.empEducation"/>
        <!-- html:errors property="empEducation"/-->
        <!-- html:text property="empEducation" styleId="empEducation" styleClass="text medium"/-->
            <html:select property="empEducation">
            	<html:options collection="educationtypes" property="value" labelProperty="label"/>
            </html:select>
    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.empSchool"/>
        <html:errors property="empSchool"/>
        <html:text property="empSchool" styleId="empSchool" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.empEduDepartment"/>
        <html:errors property="empEduDepartment"/>
        <html:text property="empEduDepartment" styleId="empEduDepartment" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.empWorkType"/>
        <!-- html:errors property="empWorkType"/-->
        <!-- html:text property="empWorkType" styleId="empWorkType" styleClass="text medium"/-->
            <html:select property="empWorkType">
            	<html:options collection="worktypes" property="workTypeId" labelProperty="workTypeName"/>
            </html:select>
    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.leaveDate"/>
        <html:errors property="leaveDate"/>
        <html:text property="leaveDate" styleId="leaveDate" styleClass="text medium"/>
            <A HREF="#" onclick="cal1.select(document.forms[0].leaveDate,'anchor2','yyyy/MM/dd');return false;"
                     title = "cal1.select(document.forms[0].leaveDate, 'anchor2', 'yyyy/MM/dd'); return false;"
                     id="anchor2" name="anchor2">                
            <fmt:message key="button.calendar"/>            
            </A> 
    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.telephone"/>
        <html:errors property="telephone"/>
        <html:text property="telephone" styleId="telephone" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.fax"/>
        <html:errors property="fax"/>
        <html:text property="fax" styleId="fax" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.address"/>
        <html:errors property="address"/>
        <html:text property="address" styleId="address" styleClass="text medium"/>

    </li>

    <li>
        <generalsetting:label styleClass="desc" key="employeeForm.address2"/>
        <html:errors property="address2"/>
        <html:text property="address2" styleId="address2" styleClass="text medium"/>

    </li>

    <li class="buttonBar bottom">
        <html:submit styleClass="button" property="method.save" onclick="bCancel=false">
            <fmt:message key="button.save"/>
        </html:submit>

        <html:submit styleClass="button" property="method.delete" onclick="bCancel=true; return confirmDelete('Employee')">
            <fmt:message key="button.delete"/>
        </html:submit>

        <html:cancel styleClass="button" onclick="bCancel=true">
            <fmt:message key="button.cancel"/>
        </html:cancel>
    </li>
</ul>
</html:form>
<SCRIPT LANGUAGE="JavaScript" SRC="scripts/CalendarPopup.js"></SCRIPT>
<script type="text/javascript">
    var cal1 = new CalendarPopup();
//cal1.showNavigationDropdowns();
    cal1.showYearNavigation(); 
	cal1.showYearNavigationInput();
    Form.focusFirstElement($("employeeForm"));
</script>

<html:javascript formName="employeeForm" cdata="false" dynamicJavascript="true" staticJavascript="false"/>
<script type="text/javascript" src="<html:rewrite page="/scripts/validator.jsp"/>"></script>
